Repository navigation
Fixes #4777: broadcast presence heartbeats on HEARTBEAT_INTERVAL - #4778
Conversation
serve broadcast presence only inside the peer-announcement task, so heartbeats went out every ANNOUNCE_INTERVAL (30s) while chat_presence documented HEARTBEAT_INTERVAL (25s) and the TTL drop-resilience it implies. HEARTBEAT_INTERVAL had no use site anywhere in the repo. Give the announce task two independent timers via tokio::select!: announcements keep ANNOUNCE_INTERVAL, presence heartbeats get their own timer driven by presence_heartbeat_period(), which returns HEARTBEAT_INTERVAL as the single source. A unit test pins that wiring (period == HEARTBEAT_INTERVAL, != ANNOUNCE_INTERVAL, two heartbeats inside one PRESENCE_TTL_SECS window) so the constant cannot silently go dead again. Fixes #4777
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 24 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Codex findings disposition (task 6781): the Codex code review on commit 95f053c did not complete — the connector reported "We couldn't complete this review" and a follow-up that Codex usage limits for code reviews were reached. No inline findings, review bodies, or suggestions were posted (verified: zero PR review comments), so there are no Codex findings to fix or rebut on this PR. CodeRabbit likewise hit its free review limit without posting findings. Verification instead: targeted tests on the laptop — |
Fixes #4777
HEARTBEAT_INTERVAL(25s) inpkgs/id/src/chat_presence.rswas defined and documented — "two to three heartbeats land inside one TTL window, so a single dropped gossip message never flickers a live node stale" — but had no use site anywhere in the repo.servebroadcast its only presence heartbeat inside the peer-announcement task, timed byANNOUNCE_INTERVAL(30s), so heartbeats actually went out every 30s against the 75s TTL: one dropped broadcast was tolerated, not the documented margin.Change (
pkgs/id/src/commands/serve.rsonly)tokio::select!: peer announcements keepANNOUNCE_INTERVAL; presence heartbeats get their own timer driven bypresence_heartbeat_period().presence_heartbeat_period()returnsHEARTBEAT_INTERVALas the single source for the cadence.presence_heartbeat_period_is_the_documented_interval: asserts the gossip-loop period equalsHEARTBEAT_INTERVAL, differs fromANNOUNCE_INTERVAL, and that two heartbeats land inside onePRESENCE_TTL_SECSwindow — so the constant cannot silently go dead again.Untouched per the packet scope:
PresenceTablesemantics,ANNOUNCE_INTERVALitself, presence scoping (#4363) and the table node bound (#4004).Verification
CI-first per repo policy: targeted tests (
cargo test --lib chat_presenceplus the new serve wiring test) run in GitHub Actions on this PR; no local build was run. Queue task 6781.